import { createRouter, createWebHistory as hashRouter} from 'vue-router';
import { funcUtils } from '../common/func-utils';
import routesM from './routerM';
import routesPC from './routerPC';

const router = createRouter({
  history: hashRouter(),
  routes: funcUtils.isMobile() ? routesM : routesPC,
  scrollBehavior: () => {
    return { top: 0 };
  }
})

router.beforeEach((to,from, next) => {
  next();
})

export default router;